<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../js/dayjs.min.js"></script>
</head>

<body>
    <div id="root">
        <h2>显示格式化后的时间</h2>
        <h3>现在是{{time | timeFormater}}</h3>
    </div>


    <script type="text/javascript">
        new Vue({
            el: '#root',
            data: {
                time: 1704206884611
            },
            computed:{
                fmtTime(){
                    return dayjs(this.time).format('YYYY-MM-DD HH:mm:ss')
                }
            },
            filters:{
                timeFormater(value){
                    return value;
                }
            }
        })



    </script>
</body>

</html>